/*
 * DataObj.h
 *
 *  Created on: Jul 5, 2012
 *      Author: plasmayang
 */





#ifndef DATAOBJ_H_
#define DATAOBJ_H_

#include "datafile.h"

#include "Fileobj.h"
#include <string>
using std::string;

namespace dataobject {
template <class T>
class DataObj {
public:
	DataObj();
	DataObj(int);
	~DataObj();

	int setEvolveFlag(const int);
	int getEvolveFlag() const;

	int setDim(int);
	int setDim(int,hsize_t *);
	int setSize(hsize_t *);
	int getDim() const;

	int setName(string);
	string getName() const;

	int get_element_type();

	const T * getData() const;
	int setData(T *);

	void show();

	int sendto(const Fileobj &,const string &) const;
	int sendto_hdf5(const Fileobj &,const string &) const;
	int sendto_mat(const Fileobj &,const string &) const;
	int sendto_txt(const Fileobj &,const string &) const;
	int sendto_netcdf(const Fileobj &,const string &) const;

	int getfrom(const Fileobj &,const string &) const;
	int getfrom_hdf5(const Fileobj &,const string &) const;
	int getfrom_mat(const Fileobj &,const string &) const;
	int getfrom_txt(const Fileobj &,const string &) const;
	int getfrom_netcdf(const Fileobj &,const string &) const;


private:
	T * data;
	int element_type;//element type
	string name;
	int evolve_flag;
	int dim;
	hsize_t * size;
};

} /* namespace dataobject */
#endif /* DATAOBJ_H_ */
